﻿class Box extends Particle {
	
	public function Update() {
		//vel.x += gravity.x;
		//vel.y += gravity.y;		
		
		if ( getVector().getLength() >= 10 ) {
			var v = getVector();
			v.setLength(10);
			setVelocity( v );
		}
		
		_x += vel.x;
		_y += vel.y;
		
		if (_x >= 550) {
			_x = 0;
		}
		if (_x < 0) {
			_x = 550;
		}
		if (_y >= 400) {
			_y = 0;
		}
		if (_y < 0) {
			_y = 400;
		}
	}
}